#include <iostream>
using namespace std;
main()
{	
	void sort(int *p,int num); 
	int a[10],i,*pointer;
	pointer=a;	
	cout<<"Input a[10]"<<endl; 
	for(i=0;i<10;i++) cin>>*(pointer+i);
	cout<<"The array a[10] as follows:"<<endl;
	for(i=0;i<10;i++) cout<<*(pointer+i)<<" ";	
	cout<<endl;
	sort(pointer,10);             
	cout<<"The sorted array as follows:"<<endl;
	for(i=0;i<10;i++) cout<<*(pointer+i)<<" ";
	return 0;
}

void sort(int *p,int num)
{
	int i,j,temp;
	for(i=0;i<num-1;i++)     //i<9,the max is a[8],a[8] compare a[9]  
		for(j=i+1;j<num;j++)
		{
			if(*(p+i)>*(p+j))
			{
				temp=*(p+i);
				*(p+i)=*(p+j);
				*(p+j)=temp;
			}
		}
}


				
	

